using Engine;
using Engine.Graphics;
using Game;

namespace SCIENEW {
    public class MagmaFluid : Fluid, IScoopableFluid, IPlaceableFluid {

        Texture2D m_texture;

        public Texture2D Texture {
            get {
                if (m_texture == null) {
                    m_texture = ContentManager.Get<Texture2D>("Textures/NormalMagma");
                }
                return m_texture;
            }
        }
        public BiDictionary<int, int> AcquireContainer(int value) => new() { { EmptyBucketBlock.Index, MagmaBucketBlock.Index } };

        public override string GetDisplayName(int value) => "岩浆";

        public override string GetCraftingID(int value) => "MagmaFluid";

        public override string GetDescription(int value) => "滋滋滋！";

        public override Texture2D GetTexture(int value) => Texture;

        public bool IsScoopable(int container, out int bucketIndex) {
            bucketIndex = 0;
            if (container == EmptyBucketBlock.Index) {
                bucketIndex = MagmaBucketBlock.Index;
                return true;
            }
            return false;
        }

        public override int GetCongenericFluidCount() => 1;

        public int GetFluidBlockIndex(int value) => MagmaBlock.Index;

        public override bool IsGlow(int value) => true;
    }
}